package cn.com.twoke.game.client.games.tic_tac_toe.constants;

import java.awt.*;
import java.awt.geom.Rectangle2D;

public interface TicTacToeGameConstant {

    int PADDING_TOP = 20;
    int PADDING_LEFT = 20;
    int PADDING_RIGHT = 20;
    int PADDING_BOTTOM = 20;

    int CELL_WIDTH = 200;
    int ROW = 3;
    int COL = 3;

    int START_X = PADDING_LEFT;
    int START_Y = PADDING_TOP;

    int GRID_BG_COLOR_HEX = 0xDEB887;
    Color GRID_BG_COLOR = new Color(GRID_BG_COLOR_HEX);
    Color FONT_COLOR = Color.BLACK;
    Color GRID_LINE_COLOR = Color.BLACK;


    static int cellX(int xIdx) {
        return START_X + xIdx * CELL_WIDTH;
    }

    static int cellY(int xIdy) {
        return START_Y + xIdy * CELL_WIDTH;
    }

    static Rectangle2D createCellRect(int xIdx, int yIdx) {
        return new Rectangle2D.Double(cellX(xIdx), cellY(yIdx), CELL_WIDTH, CELL_WIDTH);
    }

    int WINDOW_WIDTH = CELL_WIDTH * COL + PADDING_LEFT + PADDING_RIGHT;
    int WINDOW_HEIGHT = CELL_WIDTH * ROW + PADDING_TOP + PADDING_BOTTOM;

}
